#ifndef SEARCHSELECT_H
#define SEARCHSELECT_H

#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QMainWindow>
#include <QTableWidgetItem>
#include <QMediaPlayer>
#include <QAudioOutput>
namespace Ui {
class SearchSelect;
}




struct musicInfo
{
    musicInfo() {}
    int id;//歌曲ID
    QString musicName;//歌名
    QString albumName;//专辑名
    QStringList artists;//歌手
    unsigned long duration;//时长
};


class SearchSelect : public QWidget
{
    Q_OBJECT

public:
    explicit SearchSelect(QWidget *parent = nullptr);
    ~SearchSelect();

   private slots:
    void replyFinished(QNetworkReply *reply);
    void on_tableWidget_cellDoubleClicked(int row, int column);

    void on_tableWidget_cellClicked(int row, int column);

private:
    Ui::SearchSelect *ui;
public:
    QNetworkAccessManager * manager;
    QVector<musicInfo> vMusicInfo;
    int playIndex;//当前播放的歌曲的下标
    QMediaPlayer * player;
    QAudioOutput * audioOutput;
};

#endif // SEARCHSELECT_H
